package org.example.core.exception;

/**
 * @author 小杰_cc
 * @version 1.0
 */
public enum ExceptionCode {

    ERROR(500,"系统内部异常"),
    UNAUTHORIZED(401,"无权访问"),
    AUTHORIZE_CHANGE(403,"授权失效"),
    VALIDATE_ERROR(412,"数据输入不合法"),
    SAVE_ERROR(601,"保存失败"),
    REMOVE_ERROR(602,"删除失败"),
    SPU_UP_ERROR(701,"上架失败"),
    SPU_DOWN_ERROR(702,"下架失败"),
    SKU_ZERO_ERROR(703,"无SKU数据"),
    SEARCH_SKU_ERROR(801,"查询失败，请稍后再试"),
    SMS_CODE_ERROR(901,"验证码发送失败"),
    STOCK_LOCKED_ERROR(1001,"商品库存不足"),
    SYSTEM_BUSY_ERROR(1002,"购买人数过多,请稍后再试"),
    ;

    private int code;
    private String msg;

    ExceptionCode(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
